#include "Fire.h"
#include "Define.h"
#include "Global.h"
Fire::Fire(void){}

Fire::Fire (int left, int top, int _id)
{
	sprite = new Sprite (Listtexture::FIRE,Listtexture::FIRE_WIDTH,Listtexture::FIRE_HEIGHT,
		Listtexture::FIRE_COUNT,Listtexture::FIRE_SPRITEPERROW);
	id = _id;
	type = _FIRE;
	width = Listtexture::FIRE_WIDTH;
	height = Listtexture::FIRE_HEIGHT;
	UpdateRect(left,top,width,height);
	animateRate = Listtexture::FIRE_ANIMATE;
	lastAnimate = GetTickCount();
}
Fire::~Fire(void){}
void Fire::update()
{
	DWORD now = GetTickCount();
	if(now - lastAnimate > animateRate)
	{
		sprite->Next();
		lastAnimate = now;
	}
}